package jdbc;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class ResultSetUtil {
	
	private ResultSet rs=null;
	
	/**
	 * 获取记录集
	 * @param sm
	 * @param sql
	 * @return
	 * @throws SQLException
	 */
	public ResultSet getResultSet(Statement sm,String sql) throws SQLException
	{
		rs=sm.executeQuery(sql);
		return rs;
	}
	
	/**
	 * 关闭记录集
	 * @throws SQLException
	 */
	public void close() throws SQLException
	{
		rs.close();
	}

}
